Skip to content

Conversation

@arzonus
Copy link
Contributor

@arzonus arzonus commented Nov 14, 2025

What changed?
Added metrics to track shard assignment distribution and handover latency in the shard distributor service. This includes:

  • New ShardDistributorShardAssignmentDistributionLatency metric measuring time from shard assignment to distribution
  • New ShardDistributorShardHandoverLatency metric measuring handover time between executors
  • HandoverType enum (GRACEFUL/EMERGENCY) to distinguish handover types

Why?
To provide visibility into shard distribution performance and identify potential issues with shard handovers, particularly distinguishing between graceful and emergency handovers.

How did you test it?
Added comprehensive unit tests covering metric emission logic and shard statistics tracking.

Potential risks
Additional storage operations during heartbeat processing (mitigated by running metrics emission in background goroutine).

Release notes
Added shard handover latency metrics for monitoring distribution performance.

Documentation Changes
None required.

@arzonus arzonus changed the title feat(sharddistributor): add shard handover latency metrics feat(shard-distributor): add shard handover latency metrics Nov 14, 2025
@arzonus arzonus marked this pull request as draft November 18, 2025 08:47
@arzonus arzonus force-pushed the add-shard-handover-latency-metric branch 5 times, most recently from 53a34b4 to 096cd69 Compare November 24, 2025 12:18
@arzonus arzonus marked this pull request as ready for review November 24, 2025 12:21
Comment on lines +123 to +125
if len(newAssignedShardIDs) == 0 {
// no handovers happened, nothing to do
return
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if len(newAssignedShardIDs) == 0 {
// no handovers happened, nothing to do
return
}

Nit: This is not necessary, the loop below will just not run if the list is empty

@arzonus arzonus force-pushed the add-shard-handover-latency-metric branch from 096cd69 to b49bcb7 Compare November 27, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants